<template>
  <div>
    <xy-table ref="xy-table" :columns="columns" :api="api" :param="query">
      <template slot="addItem">
        <search-header :model="query" :on-search="onSearch"> </search-header>
      </template>
      <template #check="{ row }">
        <template v-if="row.InvoiceBusinessStatus !== 3">
          <el-button type="text" size="mini" @click="toCheck(row)">
            {{ $language.local("审核") }}
          </el-button>
        </template>
        <span v-else hidden></span>
      </template>
    </xy-table>
  </div>
</template>

<script>
import API from "../../plugins/api";

export default {
  name: "payroll",

  data() {
    return {
      api: new API("/api/invoiceCheck/GetList"),
      columns: {
        MerchantName: "湖南格凡安信科技有限公司",
        Indate: "2021-06-08T15:29:34.77",
        ServiceProviderName: "湖南好捷科技有限公司",
        InvoiceTaxAmount: "",
        // Amount: 0,

        InvoiceType: "",
        Invoicesubject: "",
        InvoiceBusinessStatus: 0,
        // InvoiceBusinessStatusName: null,
        Remarks: "备注",

        // Id: 544,
        // MID: 109,
        // TBID: 0,
        // InvoicesubjectId: 0,
        // unioninvoice: 0,
        // MerchantCode: "",
        // ApplicationTime: "2021-06-08T15:29:34.77",
        // ServiceProviderId: 4,
        // InvoiceRise: "",
        // InvoiceTypeId: 0,
        // InvoiceStatus: null,
        // InvoiceCategory: "",
        // InvoiceCode: "",
        // InvoiceNumber: "",
        // TaxAmount: 0,
        // InvoiceTaxAmount: 704112.02,
        // Rate: 0,
        // InvoiceFilePath: "",
        // wlgs: "",
        // wldh: "",
      },
      addForm: {
        MID: "",
        BeneficiaryName: "",
        ordrId: "",
        // CanceltrxId: "",
        refundAmount: "",
        refundReason: "",
        AttFileUrl: "",
      },

      query: {
        InvoiceBusinessStatus: "",
        BeginDate: new Date(
          new Date() - 3600 * 1000 * 24 * 30
        ).toLocaleDateString(),
        EndDate: new Date().toLocaleDateString(),
        // RechargeStatus: "",
      },
    };
  },
  created() {},
  methods: {
    onSearch(e) {
      console.log(e);
      this.$refs["xy-table"].getData(e);
    },

    toPayRefundDetail() {},
    toCheck(e) {
      console.log(e);
      window.sessionStorage.setItem(
        this.api.entity + "Data",
        JSON.stringify(e)
      );
      this.$router.push({
        path: "/detail",
        query: {
          api: this.api.check,
        },
      });
    },
  },
};
</script>

<style lang="less" scoped></style>
